﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLC.Base
{

    public class EnvData : ICloneable
    {
        Double presureIn = Double.NaN;
        Double presureOut = Double.NaN;
        Double flow = Double.NaN;
        Double temperature = Double.NaN;
        Double speed = Double.NaN;
        Double voltage = Double.NaN;
        Double current = Double.NaN;
        Double shaftPower = Double.NaN;
        Double powerfactor = Double.NaN;
        Byte[] transRadio;

        public EnvData()
        {
        }

        public EnvData(Double presureIn, Double presureOut, Double flow, Double temperature, Double speed, Double voltage, Double current, Double shaftPower, Double powerfactor)
        {
            this.presureIn = presureIn;
            this.presureOut = presureOut;
            this.flow = flow;
            this.temperature = temperature;
            this.speed = speed;
            this.voltage = voltage;
            this.current = current;
            this.shaftPower = shaftPower;
            this.powerfactor = powerfactor;
        }

        public Double Powerfactor { get => powerfactor; set => powerfactor = value; }
        public Double PresureIn { get => presureIn; set => presureIn = value; }
        public Double PresureOut { get => presureOut; set => presureOut = value; }
        public Double Flow { get => flow; set => flow = value; }
        public Double Temperature { get => temperature; set => temperature = value; }
        public Double Speed { get => speed; set => speed = value; }
        public Double Voltage { get => voltage; set => voltage = value; }
        public Double Current { get => current; set => current = value; }
        public Double ShaftPower { get => shaftPower; set => shaftPower = value; }
        public byte[] TransRadio { get => transRadio; set => transRadio = value; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();
            sb.Append("Powerfactor =" + Powerfactor + "\r");
            sb.Append("PresureIn =" + PresureIn + "\r");
            sb.Append("PresureOut =" + PresureOut + "\r");
            sb.Append("Flow =" + Flow + "\r");
            sb.Append("Temperature =" + Temperature + "\r");
            sb.Append("Speed =" + Speed + "\r");
            sb.Append("Voltage =" + Voltage + "\r");
            sb.Append("Current =" + Current + "\r");
            sb.Append("ShaftPower =" + ShaftPower + "\r");
            return sb.ToString();
        }

        public object Clone()
        {
            return MemberwiseClone();
        }
    }
}
